const express = require('express')
const router = require('./router')
const cors = require('cors');
const app = express()
const bodyParser = require('body-parser')
const compression = require('compression')

app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
// TODO:搞好node与Vue的交互

app.use(express.static('./dist/'));

// 跨域处理
app.use(cors());
// gzip配置
app.use(compression())
app.use(router);

// 启动服务器
app.listen(5000, function () {
    console.log('this Server is running..');
})